﻿using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace Hxsoft.AppV1.Admin.VoteManage.Controls
{
	public partial class ManageNavigation : BaseUserControl
	{
		#region property
		/// <summary>
		/// 当前的导航项键值。
		/// </summary>
		public string CurrentKey
		{
			get { return NavigationBar.CurrentKey; }
			set { NavigationBar.CurrentKey = value; }
		}

		/// <summary>
		/// 文章标识。
		/// </summary>
		public int VoteID
		{
			get
			{
				object oVoteID = ViewState["VoteID"];
				return oVoteID == null ? default(int) : (int)oVoteID;
			}
			set { ViewState["VoteID"] = value; }
		}


		#endregion

		protected void Page_Load(object sender, EventArgs e)
		{
			if (!IsPostBack)
			{
				BindNavigationData();
				this.DataBind();
			}
		}

		protected void BindNavigationData()
		{
			string queryString = "?VoteID=" + VoteID;

			NavigationBar.NavigationItems.Add("SettingVote", new OperationNavigationItem("调查设置", "~/VoteManage/VoteSetting.aspx" + queryString));
			NavigationBar.NavigationItems.Add("Vote", new OperationNavigationItem("投票管理", "~/VoteManage/ModifyVote.aspx" + queryString));
			NavigationBar.NavigationItems.Add("VoteResult", new OperationNavigationItem("投票结果", "~/VoteManage/VoteResult.aspx" + queryString));
			NavigationBar.NavigationItems.Add("VotePartCode", new OperationNavigationItem("嵌入代码", "~/VoteManage/VotePartCode.aspx" + queryString));
		}
	}
}